/**
 * 
 */
package com.acme.bankapp.domain.bank;

/**
 * @author Labun Konstantin
 * 
 */
public abstract class AbstractAccount implements Account {

	protected double balance;

	protected AbstractAccount(double startBalance) {
		super();
		this.balance = startBalance;
	}

	@Override
	public void deposit(double x) {
		balance += x;
	}

	/**
	 * @return the balance
	 */
	@Override
	public double getBalance() {
		return balance;
	}

	@Override
	public double maximumAmountToWithdraw() {
		return balance;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Account's balance = " + getBalance();
	}
}
